package com.woniu.outlet.elasticSearch.po;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @description:
 * @author: my
 * @time: 2021/4/22 14:09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "golds", shards = 1, replicas = 1)
public class Gold {
    @Id
    @Field(type = FieldType.Keyword)
    private String type;                //	品种代号

    @Field(type = FieldType.Text)
    private String typename;            //	品种名称

    @Field(type = FieldType.Double)
    private BigDecimal price;            //	最新价

    @Field(type = FieldType.Double)
    private BigDecimal openingprice;        //	开盘价

    @Field(type = FieldType.Double)
    private BigDecimal maxprice;            //	最高价

    @Field(type = FieldType.Double)
    private BigDecimal minprice;            //	最低价

    @Field(type = FieldType.Double)
    private BigDecimal changepercent;    //	涨跌幅

    @Field(type = FieldType.Double)
    private BigDecimal lastclosingprice;    //	昨收盘价

    @Field(type = FieldType.Double)
    private BigDecimal tradeamount;        //	总成交量

    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd hh:mm:ss")
    private Date updatetime;        //	更新时间
}
